
import request from '@/api/index'
// 1. 共用路径
let levelOneUrl  = 'cz-view-consumer/view'
// 2. 服务路径
let levelSecondUrl = 'view-service'
let levelSecondUrl1 = 'view-data'
// 3. 请求具体路径get,post,delete前缀函数
/* -----------------数据表对应-------------service--------------------*/
// 服务分页查询
export function post_queryServiceByPage(data, current, limit) {
    return request({
        url: `/${levelOneUrl}/${levelSecondUrl}/queryServiceByPage/${current}/${limit}`,
        method: 'post',
        data
    })
}
// 服务单条查询
export function get_getServiceById(id) {
    return request({
        url: `/${levelOneUrl}/${levelSecondUrl}/getServiceById/${id}`,
        method: 'get'
    })
}
// 删除单条数据
export function delete_deleteViewService(id) {
    return request({
        url: `/${levelOneUrl}/${levelSecondUrl}/deleteViewService/${id}`,
        method: 'delete'
    })
}
// 修改数据
export function post_update(data) {
    return request({
        url: `/${levelOneUrl}/${levelSecondUrl}/update`,
        method: 'post',
        data
    })
}
// 添加服务
export function post_save(data) {
    return request({
        url: `/${levelOneUrl}/${levelSecondUrl}/save`,
        method: 'post',
        data
    })
}
// 排序
export function post_changeSort(params) {
    return request({
        url: `/${levelOneUrl}/${levelSecondUrl}/changeSort`,
        method: 'post',
        params: params
    })
}
/* -----------------数据表对应-------------data--------------------*/
// 获取业务数据图层树
export function get_getViewDataTree() {
    return request({
        url: `/${levelOneUrl}/${levelSecondUrl1}/getViewDataTree`,
        method: 'get'
    })
}
